package uy.com.csi.gestpro.model.mantenimiento;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the gp_crgo database table.
 * 
 */
@Entity
@Table(name="gp_crgo", schema="mantenimiento")
@NamedQuery(name="GpCrgo.findAll", query="SELECT g FROM GpCrgo g")
public class GpCrgo implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private Integer id;

	private String dscrpcion;

	//bi-directional many-to-one association to GpPrsnal
	@OneToMany(mappedBy="gpCrgo")
	private List<GpPrsnal> gpPrsnals;

	public GpCrgo() {
	}

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getDscrpcion() {
		return this.dscrpcion;
	}

	public void setDscrpcion(String dscrpcion) {
		this.dscrpcion = dscrpcion;
	}

	public List<GpPrsnal> getGpPrsnals() {
		return this.gpPrsnals;
	}

	public void setGpPrsnals(List<GpPrsnal> gpPrsnals) {
		this.gpPrsnals = gpPrsnals;
	}

	public GpPrsnal addGpPrsnal(GpPrsnal gpPrsnal) {
		getGpPrsnals().add(gpPrsnal);
		gpPrsnal.setGpCrgo(this);

		return gpPrsnal;
	}

	public GpPrsnal removeGpPrsnal(GpPrsnal gpPrsnal) {
		getGpPrsnals().remove(gpPrsnal);
		gpPrsnal.setGpCrgo(null);

		return gpPrsnal;
	}

}